import Vue from 'vue';
const getters = {
	token: (state) => {
		return !state.common.token ? Vue.prototype.$local.get('token') : state.common.token;
	},
	menuData: (state) => {
		return state.common.menuData.length === 0 ? Vue.prototype.$local.get('menuList') : state.common
			.menuData;
	},
	authButton: (state) => {
		return state.common.authButton.length === 0 ? Vue.prototype.$local.get('authButton') : state.common
			.authButton;
	},
	siteInfo: (state) => {
		return Object.keys(state.common.siteInfo).length === 0 ? Vue.prototype.$local.get('siteInfo') : state
			.common.siteInfo;
	},
	userInfo: (state) => {
		return Object.keys(state.common.userInfo).length === 0 ? Vue.prototype.$local.get('userInfo') : state
			.common.userInfo;
	},
	dictConst: (state) => {
		return Object.keys(state.common.dictConst).length === 0 ? Vue.prototype.$local.get('dictConst') : state
			.common.dictConst;
	},
	dictEnums: (state) => {
		return Object.keys(state.common.dictEnums).length === 0 ? Vue.prototype.$local.get('dictEnums') : state
			.common.dictEnums;
	},
	siteConfig: (state) => {
		return state.common.siteConfig.length === 0 ? Vue.prototype.$local.get('siteConfig') : state.common
			.siteConfig;
	},
	departTree: (state) => {
		return state.depart.departTree;
	},
	curLibFolder: (state) => {
		return state.resource.curLibFolder;
	}
};
export default getters;